package com.huanxing.cloud.common.core.constant;

/** 权限相关常量 @Author lijx @Date 2022/1/26 16:07 */
public interface SecurityConstants {

  /** 用户ID字段 */
  String DETAILS_USER_ID = "user_id";

  /** 用户名字段 */
  String DETAILS_USERNAME = "username";

  /** 店铺字段 */
  String DETAILS_SHOP_ID = "shopId";
  /** 租户字段 */
  String DETAILS_TENANT_ID = "tenantId";

  /** 令牌类型 */
  String BEARER_TOKEN_TYPE = "Bearer";

  /** 内部 */
  String FROM_IN = "Y";

  /** 标志 */
  String FROM = "from";

  /** sys_oauth_client_details 表的字段，不包括client_id、client_secret */
  String CLIENT_FIELDS =
      "client_id, client_secret, resource_ids, scope, "
          + "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
          + "refresh_token_validity, additional_information, autoapprove";

  /** JdbcClientDetailsService 查询语句 */
  String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS + " from sys_oauth_client_details";

  /** 按条件client_id 查询 */
  String DEFAULT_SELECT_STATEMENT = BASE_FIND_STATEMENT + " where client_id = ?";

  /** 默认的查询语句 */
  String DEFAULT_FIND_STATEMENT = BASE_FIND_STATEMENT + " order by client_id";
}
